package com.magic.smartcity.view.more.models.services

import com.magic.smartcity.beans.ActivityCategoryList
import com.magic.smartcity.beans.ActivityComment
import com.magic.smartcity.beans.ActivityDetail
import com.magic.smartcity.beans.ActivityRotation
import com.magic.smartcity.beans.pojo.ActivityCommentBody
import com.magic.smartcity.beans.pojo.ResultData
import com.magic.smartcity.beans.pojo.ResultList
import io.reactivex.rxjava3.core.Observable
import retrofit2.http.*

interface ActivityService {

    /**
     * 活动轮播图列表
     */
    @GET("/prod-api/api/activity/rotation/list")
    fun getActivityRotationImage(): Observable<ResultList<ActivityRotation>>

    /**
     * 活动分类
     */
    @GET("/prod-api/api/activity/category/list")
    fun getActivityCategory(): Observable<ResultList<ActivityCategoryList>>

    /**
     * 获取活动列表
     */
    @GET("/prod-api/api/activity/activity/list")
    fun getActivityList(): Observable<ResultList<ActivityDetail>>

    /**
     * 根据id获取活动详情
     */
    @GET("/prod-api/api/activity/activity/{id}")
    fun getActivityById(@Path("id") id: Int): Observable<ResultData<ActivityDetail>>

    /**
     * 根据活动Id获取评论列表
     */
    @GET("/prod-api/api/activity/comment/list")
    fun getActivityCommentById(@Query("activityId") id: Int): Observable<ResultList<ActivityComment>>

    /**
     * 评论活动
     */
    @POST("/prod-api/api/activity/comment")
    fun activityComment(@Body activityComment: ActivityCommentBody): Observable<ResultData<ActivityComment>>

    /**
     * 检测用户是否已报名活动
     */
    @GET("/prod-api/api/activity/signup/check?=50")
    fun userIsSignup(@Query("activityId") id: Int): Observable<ResultData<ActivityComment>>

    /**
     * 报名活动
     */
    @POST("/prod-api/api/activity/signup")
    fun userSignupByActivityId(@Body activityComment: ActivityCommentBody):Observable<ResultData<ActivityComment>>
}

